package service;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import dao.MemberDAO;
import dao.ReservationDAO;
import dto.MemberDTO;
import dto.ReservationDTO;
import dto.RoomDTO;

public class ReservationService {
	private ReservationDAO dao;
	public ReservationService(ReservationDAO dao){
		this.dao = dao;
	}
	//방 가격조회
	public RoomDTO getRoomPrice(int roomNo) throws SQLException{
		return dao.selectRoomPrice(roomNo);
	}
	//예약번호seq
	public int getReservationNo() throws SQLException{
		return dao.selectReservatioNo();
	}
	//예약 등록
	public void registerReservation(ReservationDTO redto) throws SQLException{
		dao.insertReservation(redto);
	}
	//예약현황
	public ArrayList selectReservation(String memberId) throws SQLException{
		return dao.selectMyReservation(memberId);
	}
	//예약상세정보
	public HashMap selectReservationDetail(HashMap map) throws SQLException{
		return dao.selectReservationDetail(map);
	}
	//예약 삭제
	public void removeReservation(int reservationNo) throws SQLException{
		dao.removeReservation(reservationNo);
	}
	//예약현황 - 주인장
	public ArrayList selectMyReservationOwner(String memberId) throws SQLException{
		return dao.selectMyReservationOwner(memberId);
	}
	//예약수정 - 주인장
	public void modifyReservation(HashMap map) throws SQLException{
		dao.updateReservation(map);
	}
	//예약완료시 amount 수정
	public MemberDTO modifyAmount(HashMap map, String memberId) throws SQLException{
		return (MemberDTO)dao.updateAmount(map, memberId);
	}
	//예약상태 수락->거부 수정
	public void updateReCodeandAmount(HashMap map) throws SQLException{
		dao.updateReCodeandAmount(map);
	}
	//회원정보
	public MemberDTO selectMyInfo(String memberId) throws SQLException{
		return (MemberDTO)dao.selectMyInfo(memberId);
	}
}
